package com.airshare;

// Protocol
// C: REQ_HELLO <from username>
// S: RES_HELLO <from username>
// C: REQ_INDEX_SIZE
// S: RES_INDEX_SIZE <index_size in bytes>
// C: REQ_INDEX <index_message>
// S: Stream of n Index bytes 
// C: REQ_FILE_SIZE <filename>
// S: RES_FILE_SIZE <fileSize>
// C: REQ_FILE <filename>
// S: <File data> nBytes

public interface FSConstants {

	final int REQ_HELLO           = 0;      // Say Hello to server
	final int REQ_INDEX_SIZE      = 1;      // Request index of a directory REQ_INDEX dirname
	final int REQ_INDEX           = 2;
	final int REQ_FILE_SIZE       = 3;      // Request a file REQ_FILE <path/to/file>
	final int REQ_FILE            = 4;      // Request file size REQ_FILE_SIZE <path/to/file> 
	
	final int RES_HELLO           = 10;
	final int RES_INDEX_SIZE      = 11;
	final int RES_INDEX           = 12;
	final int RES_FILE_SIZE       = 13;
	final int RES_FILE            = 14;
	
	final int RES_ERR_FILE   = 20;     // Error: Requested File doesn't exist
	final int RES_ERR_DIR    = 21;     // Error: Requested File is a directory
	
	final int MAX_MESSAGE_SIZE = 4096; // Messages can be 4k max
	final int MSG_INVAL        = -1;
}
